package com.swt.testdemo.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.swt.testdemo.entity.SysUserEntity;
import com.swt.testdemo.vo.SysUserMapVO;
import com.swt.testdemo.vo.SysUserVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 
 * 
 * @author BleethNie
 * @date 2020-06-16 17:58:09
 */
@Mapper
@Repository
public interface SysUserDao extends BaseMapper<SysUserEntity> {


    Integer updateUserLoginFail(@Param("status") String status,
                                @Param("username") String username,
                                @Param("loginFailCount") Integer loginFailCount);

    Integer selectUserLoginFail(@Param("username") String username);

    SysUserEntity selectUserByName(@Param("username") String username);

    SysUserEntity queryUserById(@Param("userId") Integer userId);

    IPage<SysUserVO> listUser(Page<SysUserVO> entityPage,
                              @Param("userFilter") String userFilter,
                              @Param("areaFilter") String areaFilter,
                              @Param("statusFilter") String statusFilter);


    List<String> queryPermsByRoleId(Integer roleId);



    List<SysUserMapVO>  queryUserAsMap(@Param("userFilter") String userFilter,
                                       @Param("statusFilter") String statusFilter);

    SysUserEntity queryUserByPhone(@Param("phone") String phone);

    List<SysUserEntity> queryUserByRoleType(@Param("roleType") String roleType);
}
